package jhunter.service;

import jhunter.dao.DaoFactory;

import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.support.TransactionTemplate;

/**
 * @author jkyang
 */
public class BaseService implements Service {

	private DataSourceTransactionManager dataSourceTransactionManager;

	private DaoFactory daoFactory;

	public DaoFactory getDaoFactory() {
		return daoFactory;
	}

	public void setDaoFactory(DaoFactory daoFactory) {
		this.daoFactory = daoFactory;
	}

	public DataSourceTransactionManager getDataSourceTransactionManager() {
		return dataSourceTransactionManager;
	}

	public void setDataSourceTransactionManager(
			DataSourceTransactionManager dataSourceTransactionManager) {
		this.dataSourceTransactionManager = dataSourceTransactionManager;
	}

	public TransactionTemplate getTransactionTemplate() {
		TransactionTemplate t = new TransactionTemplate(
				dataSourceTransactionManager);
		return t;
	}

}
